﻿using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Media;
using HackingSilverlightDotNet.CustomControls;
using HackingSilverlightLibrary;

namespace SimonSilverlight
{
    public partial class MainPage : UserControl
    {
        public MainPage()
        {
            InitializeComponent();

            if (Application.Current.InstallState == InstallState.Installed)
            {
                installbutton.Visibility = Visibility.Collapsed;
            }
        }
        private void Icn_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            App.OpenWindow(((IconImageButton)sender).Tag.ToString());
        }

        private void SubTitle_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            App.OpenWindow(((TextBlock)sender).Tag.ToString());
        }

        private void SubTitle_MouseEnter(object sender, MouseEventArgs e)
        {
            ((TextBlock)sender).Foreground = new SolidColorBrush(Tools.GetColor("#FF17AEC9"));
            ((TextBlock)sender).TextDecorations = TextDecorations.Underline;
        }

        private void SubTitle_MouseLeave(object sender, MouseEventArgs e)
        {
            ((TextBlock)sender).Foreground = new SolidColorBrush(Colors.White);
            ((TextBlock)sender).TextDecorations = null;
        }

        private void installbutton_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            Application.Current.Install();
        }

        private void installwpfsimon_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            App.OpenWindow("http://hackingsilverlight.blogspot.com/2009/05/wpf-simon.html"); 
        }

        private void installwpfsimon_MouseLeftButtonUp_1(object sender, MouseButtonEventArgs e)
        {
            App.OpenWindow("http://www.hackingsilverlight.net/Downloads/WPFSimon.zip");
        }

        private void InstallSurfaceBtn_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            App.OpenWindow("http://www.hackingsilverlight.net/Downloads/SurfaceSimon.zip");
        }
    }
}
